remove the use of -Wno-unused-value
authorJan Beulich <jbeulich@suse.com>
Tue, 13 Dec 2011 10:36:35 +0000 (11:36 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 13 Dec 2011 10:36:35 +0000 (11:36 +0100)
It has been hiding actual mistakes, and there are not too many changes
necessary to make things build without suppressing this warning.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Config.mk
tools/libfsimage/common/fsimage_grub.h
xen/arch/x86/debug.c
xen/arch/x86/hvm/svm/vpmu.c
xen/arch/x86/hvm/vmx/vpmu_core2.c
xen/arch/x86/oprofile/nmi_int.c
xen/include/asm-x86/debugger.h
xen/include/asm-x86/hvm/hvm.h
xen/include/xen/tmem_xen.h
xen/include/xsm/xsm.h

index 66fbebb0b5c977e5423c023d57bf133c7cc3cc7f..e089fbd7c8fb15713f3ffa543945ac8e54e2cf4b 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -157,10 +157,6 @@ CFLAGS += -std=gnu99
 
 CFLAGS += -Wall -Wstrict-prototypes
 
-# -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
-# result of any casted expression causes a warning.
-CFLAGS += -Wno-unused-value
-
 # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
 # and is over-zealous with the printf format lint
 CFLAGS-$(clang) += -Wno-parentheses -Wno-format
index 87f89ede203b2afbb5f1d634ba1dc6ea95d16359..534c346b23d613e84d0ac91474de4a6677cdfc61 100644 (file)
@@ -57,7 +57,7 @@ typedef struct fsig_plugin_ops {
 #define        disk_read_func (*fsig_disk_read_junk())
 #define        disk_read_hook (*fsig_disk_read_junk())
 #define        print_possibilities 0
-#define        noisy_printf
+#define        noisy_printf(fmt...)
 
 #define        grub_memset memset
 #define        grub_memmove memmove
index 8e3617a331ab5532e9696b7ce2da54584308cc67..35f8d2e5bd8c10cfe297ccc1c2912fdf559429e1 100644 (file)
@@ -37,8 +37,8 @@
 #define DBGP1(...) {(kdbdbg>1) ? kdbp(__VA_ARGS__):0;}
 #define DBGP2(...) {(kdbdbg>2) ? kdbp(__VA_ARGS__):0;}
 #else
-#define DBGP1(...) {0;}
-#define DBGP2(...) {0;}
+#define DBGP1(...) ((void)0)
+#define DBGP2(...) ((void)0)
 #endif
 
 /* Returns: mfn for the given (hvm guest) vaddr */
index 65bb20692abd389a8d3cf67e453b8b98eca95190..30288a4fc59c05a395016f7d2f406c31329b593b 100644 (file)
@@ -154,7 +154,7 @@ static int amd_vpmu_do_interrupt(struct cpu_user_regs *regs)
     if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
         vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
     else
-        test_and_set_bool(v->nmi_pending);
+        v->nmi_pending = 1;
 
     return 1;
 }
index 6d23880a38554ff3cfee5a443c3aa9dee039ae27..19ac9cbb0477828be501a478278090a745592cd7 100644 (file)
@@ -574,7 +574,7 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
     if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
         vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
     else
-        test_and_set_bool(v->nmi_pending);
+        v->nmi_pending = 1;
     return 1;
 }
 
index 70930b245a6e2b878c9d28b14cabbfca9dd98330..a58a0e98923fb702c39696f218cf8462e8d83203 100644 (file)
@@ -92,7 +92,7 @@ static int nmi_callback(struct cpu_user_regs *regs, int cpu)
                send_guest_vcpu_virq(current, VIRQ_XENOPROF);
 
        if ( ovf == 2 ) 
-                test_and_set_bool(current->nmi_pending);
+                current->nmi_pending = 1;
        return 1;
 }
  
index e47935f631aab6cdacd2744610081b05dc02be85..0408bec89640ca954b0b2a00a62668c4780e8018 100644 (file)
@@ -55,7 +55,12 @@ static inline int debugger_trap_fatal(
 
 #else
 
-#define debugger_trap_fatal(v, r) (0)
+static inline int debugger_trap_fatal(
+    unsigned int vector, struct cpu_user_regs *regs)
+{
+    return 0;
+}
+
 #define debugger_trap_immediate() ((void)0)
 
 #endif
index 5373dab51ecff76cf9e78564ed94262575686bba..826cb3302cab51610ece3a9ccc732190b58171c2 100644 (file)
@@ -235,7 +235,7 @@ int hvm_girq_dest_2_vcpu_id(struct domain *d, uint8_t dest, uint8_t dest_mode);
 #define hvm_long_mode_enabled(v) \
     ((v)->arch.hvm_vcpu.guest_efer & EFER_LMA)
 #else
-#define hvm_long_mode_enabled(v) (v,0)
+#define hvm_long_mode_enabled(v) ((void)(v),0)
 #endif
 
 enum hvm_intblk
index 3dbf6f800adb3efe2ef143cb5c2cd5a3ff2aa550..76ab44069e0de06ef0a182db7a32c16d2f02e271 100644 (file)
@@ -365,7 +365,7 @@ static inline int tmh_page_cmp(pfp_t *pfp1, pfp_t *pfp2)
     // FIXME: code in assembly?
 ASSERT(p1 != NULL);
 ASSERT(p2 != NULL);
-    for ( i = PAGE_SIZE/sizeof(uint64_t); i && *p1 == *p2; i--, *p1++, *p2++ );
+    for ( i = PAGE_SIZE/sizeof(uint64_t); i && *p1 == *p2; i--, p1++, p2++ );
     if ( !i )
         return 0;
     if ( *p1 < *p2 )
@@ -386,7 +386,7 @@ static inline int tmh_pcd_cmp(void *va1, pagesize_t len1, void *va2, pagesize_t
     if ( len1 > len2 )
         return 1;
     ASSERT(len1 == len2);
-    for ( i = len2; i && *p1 == *p2; i--, *p1++, *p2++ );
+    for ( i = len2; i && *p1 == *p2; i--, p1++, p2++ );
     if ( !i )
         return 0;
     if ( *p1 < *p2 )
@@ -413,7 +413,7 @@ static inline int tmh_tze_pfp_cmp(pfp_t *pfp1, pagesize_t pfp_len, void *tva, pa
     if ( pfp_len > tze_len )
         return 1;
     ASSERT(pfp_len == tze_len);
-    for ( i = tze_len/sizeof(uint64_t); i && *p1 == *p2; i--, *p1++, *p2++ );
+    for ( i = tze_len/sizeof(uint64_t); i && *p1 == *p2; i--, p1++, p2++ );
     if ( !i )
         return 0;
     if ( *p1 < *p2 )
index 0afe49f437c63987236a996cf1304eae6a823fa0..ce3b6aa9d5a80d12d8c19eb511430a5f49ee9026 100644 (file)
@@ -163,7 +163,7 @@ extern struct xsm_operations *xsm_ops;
 static inline void xsm_security_domaininfo (struct domain *d,
                                         struct xen_domctl_getdomaininfo *info)
 {
-    xsm_call(security_domaininfo(d, info));
+    (void)xsm_call(security_domaininfo(d, info));
 }
 
 static inline int xsm_setvcpucontext(struct domain *d)
@@ -310,7 +310,7 @@ static inline int xsm_evtchn_interdomain (struct domain *d1,
 
 static inline void xsm_evtchn_close_post (struct evtchn *chn)
 {
-    xsm_call(evtchn_close_post(chn));
+    (void)xsm_call(evtchn_close_post(chn));
 }
 
 static inline int xsm_evtchn_send (struct domain *d, struct evtchn *chn)
@@ -366,7 +366,7 @@ static inline int xsm_alloc_security_domain (struct domain *d)
 
 static inline void xsm_free_security_domain (struct domain *d)
 {
-    xsm_call(free_security_domain(d));
+    (void)xsm_call(free_security_domain(d));
 }
 
 static inline int xsm_alloc_security_evtchn (struct evtchn *chn)
@@ -376,7 +376,7 @@ static inline int xsm_alloc_security_evtchn (struct evtchn *chn)
 
 static inline void xsm_free_security_evtchn (struct evtchn *chn)
 {
-    xsm_call(free_security_evtchn(chn));
+    (void)xsm_call(free_security_evtchn(chn));
 }
 
 static inline int xsm_memory_adjust_reservation (struct domain *d1, struct